import axios from 'poros/http';

// 登录
export function login(data) {
  return axios({
    url: '/api/poros-authcenter/login',
    method: 'post',
    data,
  });
}

// 退出登录
export function logout() {
  return axios({
    url: '/api/poros-authcenter/user/logout',
    method: 'get',
  });
}

// 获取用户信息
export function getUser() {
  return axios({
    url: '/api/poros-authcenter/user/message',
    method: 'get',
  });
}

export function getKey(params) {
  return axios({
    url: '/api/poros-authcenter/secret/',
    method: 'get',
    params,
  });
}

// 获取菜单
export function getCurrentUserNav(params) {
  return axios({
    url: '/api/poros-permission/menu/menus',
    method: 'get',
    params,
  });
}

// 获取用户列表
export function userList(params) {
  return axios({
    url: '/api/poros-permission/secStaff/list',
    method: 'get',
    params,
  });
}

// 获取当前登录人管理的系统列表
export function manageSysList() {
  return axios({
    url: '/api/poros-permission/sys/uid',
    method: 'get',
  });
}

// 通过字典code 获取对应的字典
export function dicListByCode(params) {
  return axios({
    url: '/api/poros-permission/dict/data/list',
    method: 'get',
    params,
  });
}

// 获取子组织
export function groupListChild(params) {
  return axios({
    url: '/api/poros-permission/secOrg/bizList',
    method: 'get',
    params,
  });
}

// 获取一级组织
export function groupList(params) {
  return axios({
    url: '/api/poros-permission/secOrg/list',
    method: 'get',
    params,
  });
}

// 获取组织下的人员
export function groupMember(params) {
  return axios({
    url: '/api/poros-permission/secOrg/getMember',
    method: 'get',
    params,
  });
}

// 获取邮件模板
export function templateList(params) {
  return axios({
    url: '/api/poros-notify/mail/template/list',
    method: 'get',
    params,
  });
}

export function getklm(params) {
  return axios({
    url: '/api/klm-dataservice/fileInfo/list',
    method: 'get',
    params,
  });
}
export function apiTest(params) {
  return axios({
    url: '/api/porostrain/demo/hello',
    method: 'get',
    params,
  });
}
export const postExportList = data =>
  axios({
    url: '/api/salesforecast-service/modelInfo/export',
    method: 'post',
    data
  });